import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:sph_driver/AppConfig/Config.dart';

import '../../l10n/messages.dart';

class MessageSetting extends StatefulWidget {
  const MessageSetting({super.key});

  @override
  State<MessageSetting> createState() => _MessageSettingState();
}

class _MessageSettingState extends State<MessageSetting> {

  bool switchValue = true;

  @override
  Widget build(BuildContext context) {
    var messages = AppLocalizations.of(context)!;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        title: Text(messages["消息设置"],style: TextStyle(fontWeight: FontWeight.w300,fontSize: 16.sp),),
        centerTitle: true,
        backgroundColor: Colors.white,

      ),
      body: ListView(
        children: [
          Container(
            color: Colors.white,
            padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 10.h,bottom: 10.h),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text("运力播报通知提醒",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                    Text("接收运单提示",style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                  ],
                ),
                CupertinoSwitch(
                  value: switchValue,
                    activeColor:MyColors.themeColor,
                  onChanged: (bool value) {
                    setState(() {
                      switchValue = value;
                    });
                  },
                ),
              ],
            ),
          ),
          SizedBox(height: 8.h,),
          Container(
            padding: EdgeInsets.only(left: 15.w,top:10.h,bottom: 10.h ),
            color: Colors.white,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                GestureDetector(
                  child: Column(
                    children: [
                      Text("清空通知消息",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                      Text("默认30天自动清空",style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                      SizedBox(height: 10.h,),
                    ],
                  ),
                  onTap: (){

                  },
                ),

                Container(height: 1.h,color: MyColors.backgreyColor,),
                GestureDetector(
                  child: Column(
                      children: [
                        SizedBox(height: 10.h,),
                        Text("清空活动消息",style: TextStyle(color: Colors.black,fontSize: 16.sp),),
                        Text("默认30天自动清空",style: TextStyle(color: MyColors.textColor,fontSize: 12.sp),),
                      ]
                  ),
                  onTap: (){
                    
                  },
                ),

              ],
            ),
          )
        ],
      ),
    );
  }
}
